# 生成dcp文件流程

# set argv [list /home/wj/tmp/project_1 xc7z100ffg900-2 main]
#
# vivado的tcl窗口里运行
# source /home/wj/vimrc/linux_config/creat_project_from_gui.tcl
#
# 或者终端里运行
# vivado -source /home/wj/vimrc/linux_config/creat_project_from_gui.tcl


set project_path /home/wj/tmp/project_1
set device_type xc7z100ffg900-2
set project_name main


if {[file exists $project_path]} {
    # 删除目录
    file delete -force $project_path
    puts "目录已成功删除。"
}

# 创建工程
create_project $project_name $project_path -part $device_type

set_property -name {STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS} -value {-mode out_of_context} -objects [get_runs synth_1]

#  # 添加源文件
# add_files [ glob /home/wj/study/hdl_example/common/uart/rx_part.v ]
add_files /home/wj/study/hdl_example/common/uart/rx_part.v 
add_files /home/wj/study/hdl_example/common/uart/tx_part.v 
add_files /home/wj/study/hdl_example/common/uart/uart.v

update_compile_order -fileset sources_1
launch_runs synth_1
wait_on_run synth_1

open_run synth_1 -name synth_1
write_checkpoint  $project_path/$project_name.dcp
